<template>
	<view class="page">
		<CustomNav :isBack="false" color="#fff"  title="登录"></CustomNav>
		<image :src="cloudStorage+'/detail_bg_zl.png'" class="bg-img" mode="widthFix"></image>
		<view class="login-block">
			<!-- <view class="login-title LENGKU">肃州区数据资源池综合分析</view> -->
			<view class="login-form">
				<view class="input-item">
					<text class="label">账号</text>
					<input type="text" v-model="form.username" placeholder="请输入账号" placeholder-class="input-placeholder" />
				</view>
				<view class="input-item">
					<text class="label">密码</text>
					<input type="password" v-model="form.password" placeholder="请输入密码" placeholder-class="input-placeholder" />
				</view>
				<button class="btn normal" @click="handleLogin">登 录</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					username: '',
					password: ''
				}
			}
		},
		methods: {
			handleLogin() {
				// 前端写死账号密码验证
				if(this.form.username === 'admin' && this.form.password === 'szqzyc2025!') {
					uni.showToast({
						title: '登录成功',
						icon: 'success'
					});
					// 登录成功后跳转到首页
					setTimeout(() => {
						uni.reLaunch({
							url: '/pages/index/index'
						});
					}, 1500);
				} else {
					uni.showToast({
						title: '账号或密码错误',
						icon: 'none'
					});
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		overflow: hidden;
		min-height: 100vh;
		background-color: #FFFFFF;

		.bg-img {
			width: 100%;
		}

		.login-block {
			position: relative;
			padding: 30rpx;
			margin-top: -100rpx;

			.login-title {
				font-size: 48rpx;
				color: #0256ff;
				font-weight: bold;
				text-align: center;
				margin-bottom: 60rpx;
			}

			.login-form {
				background: #FFFFFF;
				border-radius: 30rpx;
				padding: 40rpx;
				box-shadow: 0 0 20rpx rgba(0,0,0,0.1);

				.input-item {
					margin-bottom: 30rpx;

					.label {
						font-size: 32rpx;
						color: #333;
						margin-bottom: 20rpx;
						display: block;
					}

					input {
						width: 100%;
						height: 90rpx;
						background: #f8f8f8;
						border-radius: 45rpx;
						padding: 0 30rpx;
						font-size: 30rpx;
					}
				}

				.btn {
					width: 100%;
					height: 90rpx;
					margin-top: 60rpx;
					font-size: 32rpx;
				}
			}
		}
	}
</style> 